<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:variable name="lotid" select="0"/>
 
<xsl:template match="/lotteries">

  <xsl:copy>

     <xsl:for-each select="./lottery">

       <xsl:sort select="@locale" data-type="text" order="ascending"/>
       <xsl:sort select="@name" data-type="text" order="ascending"/>

       <xsl:copy-of select="."/>

     </xsl:for-each>

   </xsl:copy>

 </xsl:template>

</xsl:stylesheet>
